#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<assert.h>
#include<stdlib.h>
int com_int(const void* e1,const void* e2)
{
    assert(e1 != NULL);
	assert(e2 != NULL);
	return *(int*)e2 - *(int*)e1;
}
int main()
{
	int arr[50] = {0};
	int i = 0;
	int n = 0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
	    scanf("%d",&arr[i]);
	}
	qsort(arr,n,sizeof(int),com_int);
	for(i=0;i<5;i++)
	{
	    printf("%d ",arr[i]);
	}
	return 0;
}

